Repository navigation
Conversation
…r stays out Ferrum 0.21 runs on(:dialog) callbacks as a chain and accepts a dialog nobody handled with a warning. Cuprite listened to the raw Page.javascriptDialogOpening event, so Ferrum accepted every dialog first, dismissals and prompt responses were lost, and a test stubbing warn killed the dispatcher thread.
Member
Author
|
Superseded by #366. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ferrum runs
on(:dialog)callbacks as a chain since rubycdp/ferrum#703. A dialog no callback handles is accepted with a warning. Cuprite listened to the rawPage.javascriptDialogOpeningevent, so Ferrum's default didn't see it:Page.handleJavaScriptDialogthen failed.dismiss_confirm,dismiss_promptandaccept_promptwith a response all ended up as a plain accept.warnto expect Cuprite's unhandled modal message got Ferrum's instead. The RSpec mock error isn't aStandardError, so it killed Ferrum's event thread. No target events arrived after that, and every later spec failed withFerrum::NoSuchTargetError: 1749 of 1813 examples against Ferrum main.Cuprite now registers
on(:dialog)and answers withdialog.accept(response)ordialog.dismiss, which marks the dialog handled, so Ferrum's default stays out.Dialog#acceptgoes throughpage.command, Cuprite's override that raises a stashedUnhandledModalError. That runs on Ferrum's event thread, so the override skips the check while Cuprite answers a dialog. Otherwise an error stashed by an earlier dialog would be raised there and leave this one unanswered.Against Ferrum main (99b6c17):
bundle exec rspec spec/browser/extensions_spec.rb spec/driver_spec.rb -e raise_on_unhandled_modal -e accept_modal: 6 examples, 0 failuresbundle exec rspec spec/capybara_spec.rb -e accept_alert -e accept_confirm -e accept_prompt -e dismiss_confirm -e dismiss_prompt: 29 examples, 0 failures